package com.bbdjt.weixin.service.impl;

import java.util.List;


import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.util.StringUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.bbdjt.weixin.model.InterflowQueryModel;
import com.bbdjt.weixin.base.service.impl.BaseServiceImpl;
import com.bbdjt.weixin.dao.InterflowDao;
import com.bbdjt.weixin.model.Interflow;
import com.bbdjt.weixin.service.InterflowService;

@Service("interflowService")
public class InterflowServiceImpl extends BaseServiceImpl<Interflow> implements InterflowService {
	
	@Override
    public List<Interflow> selectByInterflow(Interflow interflow, int page, int rows) {
        Example example = new Example(Interflow.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo(interflow);
        PageHelper.startPage(page, rows);
        return selectByExample(example);
    }
    
    @Override
    public List<Interflow> selectByInterflow(Interflow interflow) {
        Example example = new Example(Interflow.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo(interflow);
        return selectByExample(example);
    }

    @Override
    public PageInfo<InterflowQueryModel> selectByInterflowQueryModel(InterflowQueryModel interflow) {
    	return ((InterflowDao) getMapper()).selectByInterflowModel(interflow);
    }

	@Override
	public List<Interflow> selectByInterflow(InterflowQueryModel interflow) {
		  Example example = new Example(Interflow.class);
	        Example.Criteria criteria = example.createCriteria();
	        criteria.andEqualTo(interflow);
	        PageHelper.startPage(interflow.getPageNum(), interflow.getPageSize(),interflow.getOrderBy());
	        return selectByExample(example);
	}

	@Override
	public List<Interflow> interflowPatientSyllabus(Interflow interflow) {
		return ((InterflowDao) getMapper()).interflowPatientSyllabus(interflow);
	}

}